<%
'ShowURLCLassName '根据id显示网址类型
'ShowURLLogName 根据id显示网址日志类型
'ShowTargetTitle 根据id显示目标标题

'数据库表行数函数，这是取表的行数
Function GetTblRows(TblName)
    '如果TblName表名值为空，则
    if TblName="" Then
	   GetTblRows="未知TblName"
    exit Function
    Else
	   set rec = server.createobject("adodb.recordset")
	   'SQL="EXEC AnySite_IT.dbo.sp_spaceused "&TblName
	   SQL="EXEC sp_spaceused "&TblName
       rec.open sql,conn,1,1
       GetTblRows=Trim(rec("rows"))
       rec.close
	   set rec=nothing
	end if
End Function

'//函数名：根据id显示目标标题
Function ShowTargetTitle(id)
	dim rec
	set rec = server.createobject("adodb.recordset")
	sql_show= "select * from Plan_target where T_id="&id
	rec.open sql_show,conn,3
	if not rec.eof then
	   ShowTargetTitle=Trim(rec("T_Title"))
	else
	   ShowTargetTitle="未定义"
	end if
	set rec=nothing
End Function

'//函数名：根据id显示网址类型
Function ShowURLCLassName(id)
	dim rec
	set rec = server.createobject("adodb.recordset")
	sql_show= "select * from Plan_URLClass where type_id="&id
	rec.open sql_show,conn,3
	if not rec.eof then
	   ShowURLCLassName=Trim(rec("type_name"))
	else
	   ShowURLCLassName="未定义"
	end if
	set rec=nothing
End Function

'//函数名：根据id显示网址日志类型
Function ShowURLLogName(id)
	dim rec
	set rec = server.createobject("adodb.recordset")
	sql_show= "select * from Plan_URLLogType where id="&id
	rec.open sql_show,conn,3
	if not rec.eof then
	   ShowURLLogName=Trim(rec("title"))
	else
	   ShowURLLogName="未定义"
	end if
	set rec=nothing
End Function

'//函数名：根据id显示优先级名称
Function ShowFlagName(id)
	dim rec
	set rec = server.createobject("adodb.recordset")
	sql_show= "select * from Plan_flag where id="&id
	rec.open sql_show,conn,3
	if not rec.eof then
	   ShowFlagName=rec("title")
	else
	   ShowFlagName="未定义"
	end if
	set rec=nothing
End Function

'//函数名：根据id显示优先级背景颜色
Function ShowFlagColor(id)
	dim rec
	set rec = server.createobject("adodb.recordset")
	sql_show= "select * from Plan_flag where id="&id
	rec.open sql_show,conn,3
	if not rec.eof then
	   ShowFlagColor=rec("BG_color")
	else
	   ShowFlagColor="#ffffff"
	end if
	set rec=nothing
End Function

'//函数名：HTML格式化字符
function HtmlCode(str)
    str=replace(str,"'","’")
    str=replace(str,"""","&quot;")
    str=replace(str," ","&nbsp;")
    str=replace(str,"<","&lt;")
    str=replace(str," ","&gt;")
    str=replace(str,chr(13),"<br>")
    HtmlCode=str
End Function

'//函数名：默认当前日期
strdate=Trim(Request("currentDate"))
If strdate="" Then
strdate=Date()
Else
strdate=strdate
End If

'//函数名：显示性别
Function GetSex(id)
    If int(ID)=0 Then
    ID=0
	End if
	if ID=1 then
	   GetSex="男"
	else
	   GetSex="女"
	end if
End Function


'//函数名：根据id显示Property_type名称
Function GetProType(id)
    if trim(id)="" then
	''判断输入是否为空
	   GetProType="未定义"
       exit function
	end if
	dim rec
	set rec = server.createobject("adodb.recordset")
	sql_show= "select top 1 * from Contact_propertyType where id="&trim(id)
	rec.open sql_show,conn,3
	if not rec.eof then
	   GetProType=Trim(rec("title"))
	else
	   GetProType="未定义"
	end if
	set rec=nothing
End Function
%>